using AppodealAds.Unity.Api;
using UnityEngine;
using UnityEngine.UI;

public class EndMatchHUD : MonoBehaviour
{
	public Text PlayerName;

	public Text KillCount;

	public Text Rank;

	public Text Rank2;

	private void Start()
	{
	}

	private void OnEnable()
	{
		if (Appodeal.isLoaded(128))
		{
			Appodeal.show(128);
		}
		PlayerData playerData = UnitZ.NetworkGameplay.playersManager.GetPlayerData(UnitZ.gameManager.PlayerNetID);
		if ((bool)PlayerName)
		{
			PlayerName.text = playerData.Name;
		}
		if ((bool)KillCount)
		{
			KillCount.text = playerData.Score.ToString();
		}
		if ((bool)Rank)
		{
			Rank.text = "# " + UnitZ.NetworkGameplay.EndgameRanked.ToString();
		}
		if ((bool)Rank2)
		{
			Rank2.text = "# " + UnitZ.NetworkGameplay.EndgameRanked.ToString() + "/" + UnitZ.NetworkGameplay.PlayersAliveMax.ToString();
		}
	}

	public void EnableSpectre(bool on)
	{
		if ((bool)UnitZ.playerManager)
		{
			UnitZ.playerManager.SpectreMode(on);
		}
	}

	public void QutGame()
	{
		base.gameObject.SetActive(value: false);
		if ((bool)UnitZ.gameManager)
		{
			UnitZ.gameManager.QuitGame();
		}
	}
}
